﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Layout/SiteHead.master" AutoEventWireup="true"
	CodeBehind="ListNews.aspx.cs" Inherits="FOBTV.Web.Admin.ListNews" %>

<%@ Register Src="~/InfoControls/Pagination.ascx" TagName="Pagination" TagPrefix="suc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	新闻列表
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
	<script type="text/javascript">
		function linkAdd()
		{
			var iwidth = window.screen.width;
			var iheight = window.screen.height;
			iwidth = iwidth < 500 ? 500 : iwidth;
			iheight = iheight < 400 ? 400 : iheight;
			var addArticleurl = "EditNew.aspx?action=add";
			var isclose = OpenWindowWithSize(addArticleurl, iwidth, iheight);
			//if (isclose) {
			//window.location.reload();
			//}
		}
		function linkEdit(newsId)
		{
			var iwidth = window.screen.width;
			var iheight = window.screen.height;
			iwidth = iwidth < 500 ? 500 : iwidth;
			iheight = iheight < 400 ? 400 : iheight;
			var editArticleurl = "EditNew.aspx?action=edit&&newsId=" + newsId;
			var isclose = OpenWindowWithSize(editArticleurl, iwidth, iheight);
			//if (isclose) {
			//window.location.reload();
			//}
		}
		function viewcontent(newsid)
		{
			window.open("PreviewNews.aspx?newsId=" + newsid, "", "width=800,height=510,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0");
		}
		$(function ()
		{
			$("#<%=TxbStartDate.ClientID%>").datepicker({ dateFormat: 'yy/mm/dd', disabled: true });
			$("#<%=TxbEndDate.ClientID%>").datepicker({ dateFormat: 'yy/mm/dd', disabled: true });
		});
		function isdatenull()
		{
			var startdate = $("#<%=TxbStartDate.ClientID%>").val();
			var enddate = $("#<%=TxbEndDate.ClientID%>").val();
			if (startdate.length != 10 || enddate.length != 10)
			{
				alert("请选择正确的开始或结束时间！");
				return false;
			}
			return true;
		}
	</script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="SubMinTitle" runat="server">
	查看内容：按时间：
	<asp:TextBox ID="TxbStartDate" Columns="12" runat="server"></asp:TextBox>
	<span class="newfont06">至</span>
	<asp:TextBox ID="TxbEndDate" Columns="12" runat="server"></asp:TextBox>
	<asp:Button ID="BtnSearchRecord" OnClientClick="return isdatenull();" CssClass="right-button02"
		runat="server" OnClick="BtnSearchRecord_Click" Text="查 询" />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainContent" runat="server">
	<table id="subtree1" style="display: " width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td>
				<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
					<tr>
						<td height="20">
							<span class="newfont07">选择：<a href="#" class="right-font08" onclick="selectAll('ChkSelect');">全选</a>-<a
								href="#" class="right-font08" onclick="unselectAll('ChkSelect');">反选</a></span>
							<asp:Button ID="btnDeleteSelect" CssClass="right-button08" OnClientClick="return confirmDelete('ChkSelect',true);"
								OnClick="BenDeleteSelect" runat="server" Text="删除所选新闻" />
							<input name="Submit2" type="button" class="right-button08" value="添加新闻" onclick="linkAdd();" />
						</td>
					</tr>
					<tr>
						<td height="40" class="font42">
							<table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#464646"
								class="newfont03">
								<tr class="CTitle">
									<td height="22" colspan="13" align="center" style="font-size: 16px">
										新闻列表
									</td>
								</tr>
								<tr align="center" bgcolor="#EEEEEE">
									<td align="center" height="30">
										选择
									</td>
									<td>
										标题
									</td>
									<td>
										栏目名称
									</td>
									<td>
										新闻来源
									</td>
									<td>
										新闻分类
									</td>
									<td>
										发布者
									</td>
									<td>
										发布时间
									</td>
									<td>
										是否首页推荐
									</td>
									<td>
										权重排序
									</td>
									<td>
										内容简介
									</td>
									<td>
										编辑
									</td>
									<td>
										查看
									</td>
									<td>
										删除
									</td>
								</tr>
								<asp:Repeater ID="rptNewsList" runat="server">
									<ItemTemplate>
										<tr class="listitems <%#(rptNewsList.Items.Count%2==0?"odd":"even")%>">
											<td align="center" height="20" class="item40">
												<asp:HiddenField ID="HiddenId" runat="server" Value='<%#DataBinder.Eval(Container.DataItem, "Id")%>' />
												<asp:CheckBox ID="ChkSelect" runat="server" />
											</td>
											<td nowrap="nowrap">
												<a href="#" onclick="viewcontent(<%#Eval("Id")%>)">
													<%#GetShortNewsTitle(Eval("NewsTitle").ToString())%></a>
											</td>
											<td nowrap="nowrap" class="item80">
												<%#Eval("NewsType").ToString()%>
											</td>
											<td nowrap="nowrap" class="item80">
												<%#Eval("NewsSource").ToString()%>
											</td>
											<td nowrap="nowrap" class="item80">
												<%#Eval("NewsCategory").ToString()%>
											</td>
											<td nowrap="nowrap" class="item80">
												<%#Eval("Publisher").ToString()%>
											</td>
											<td nowrap="nowrap" class="item160">
												<%#Eval("PublishDate")%>
											</td>
											<td nowrap="nowrap" class="item80">
												<%#Convert.ToBoolean(Eval("IsRecommend"))==true? '是':'否'%>
											</td>
											<td nowrap="nowrap" class="item80">
												<%#Eval("NewsIndex").ToString()%>
											</td>
											<td nowrap="nowrap">
												<%#GetShortNewsContent(Eval("NewsContent").ToString())%>
											</td>
											<td class="item40">
												<a class="opt" href="#" onclick="linkEdit(<%#Eval("Id")%>)"><span class="icon-sprite icon-edit">
												</span></a>
											</td>
											<td class="item40">
												<a class="opt" href="#" onclick="viewcontent(<%#Eval("Id")%>)"><span class="icon-sprite icon-view">
												</span></a>
											</td>
											<td class="item40">
												<asp:LinkButton ID="lnkDeleteNews" CssClass="opt" OnClick="DeleteNewsByLink" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "Id")%>'
													OnClientClick="return confirmDelete('ChkSelect',false);" runat="server"><span class="icon-sprite icon-delete"></span>
												</asp:LinkButton>
											</td>
										</tr>
									</ItemTemplate>
								</asp:Repeater>
							</table>
						</td>
					</tr>
				</table>
				<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
					<tr>
						<td height="6">
							<img alt="" src="../Style/images/spacer.gif" width="1" height="1" />
						</td>
					</tr>
					<tr>
						<td height="33">
							<suc:Pagination ID="Pagination" PageSize="12" runat="server"></suc:Pagination>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="MainBody" runat="server">
</asp:Content>
